home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / tbbs / ll_110.zip / LOGLIST.DOC < prev    next >
Text File  |  1996-05-27  |  21KB  |  573 lines

  1.  
  2.                             TBBS Log-Lister
  3.  
  4.                              by Paul Blitz
  5.  
  6.                              Version 1.10
  7.                                20 May 96
  8.  
  9.  
  10. Introduction
  11. ============
  12.  
  13. Last year, I wrote some simple programs to list out certain (fixed) fields
  14. from the userlog to a text file. Michael Muller suggested that a more
  15. complete & more flexible program would be useful, especially so that the
  16. output files could be used with TYPE 1 & 2 text listing commands. Another
  17. sysop later pointed out that LogLister will also be suitable to produce
  18. simple lists to use with type 20 Keyword Searches.
  19.  
  20. Log-Lister allows you to create your own customised lists from your TBBS
  21. userlog file. These files list one user's details per line, and may include
  22. colourisation commands (using "%Xnn%" sequences), fixed text, headings,
  23. tabs, as well as the data itself.
  24.  
  25. The "definition" of the output is made in the configuration file: you can
  26. have several of these, and simply call up the one you want to use on the
  27. program's command line.
  28.  
  29. Log-Lister is a DOS program, and would typically be called as part of your
  30. night-time external event, from the relevant batch file (that's YOUR
  31. problem, not mine... <grin>)
  32.  
  33. This version of Log Lister has been written for use with TBBS 2.3.
  34.  
  35.  
  36. New in version 1.10
  37. ===================
  38.  
  39. It suddenly occurred to me that, in this world of the Internet, I ought to
  40. be supporting HTML somehow! The main thing that the program needed was the
  41. ability to ignore <things inside HTML "codes">.... which is what I've done.
  42. If you include the "X2" keyword, then anything within "<>" pairs is ignored
  43. (as far as delting excessive text) when tabs are done, just like %Xnn%
  44. sequences are ignored.
  45.  
  46.  
  47. Future Versions
  48. ===============
  49.  
  50. I hope that there will be enough interest to make it worthwhile improving
  51. the program further.... if you have any suggestions for improvements to
  52. the program, then let me know (see the end for contact addresses)
  53.  
  54. When you register, your "registration key" will be valid for all future
  55. "non-major" upgrades to the program.
  56.  
  57.  
  58. Running the program
  59. ===================
  60.  
  61. LOGLIST.EXE and your TBBS userlog (USERLOG.BBS) do *not* need to be
  62. together in the same directory, as long as you define a full path to your
  63. userlog. Unless Borland have screwed up the pascal compiler, your userlog
  64. is only ever opened for READING, so your userlog won't be disturbed in any
  65. way.
  66.  
  67. The program calling syntax is:
  68.  
  69.     LOGLIST <config file>
  70.  
  71. If you don't give a config file, then "LOGLIST.CFG", in the current
  72. directory, will be used.
  73.  
  74. The filename may include a full pathname, upto a maximum length of 50
  75. characters.
  76.  
  77. The config file not only contains formatting information, but gives the
  78. paths & filenames for the USERLOG.BBS file, the output text file, and the
  79. log file. This allows you to have multiple configuration files to produce
  80. several output files.
  81.  
  82.  
  83. The program will return one of several error levels when it exits:
  84.  
  85.     0 : Program ran OK
  86.     1 : Error in command line parameters
  87.     2 : Can't find file
  88.     3 : Error in config file
  89.     9 : Control-C / Escape was pressed during program
  90.     99: Internal processing error (eg: out of range value)
  91.  
  92. All errors will also return an error message on the screen (and the log
  93. file), with as much useful information as possible.
  94.  
  95. To help get you going, I've included some demo config files... if *you* do
  96. any good configs, please send them to me, and I'll include them (and then
  97. you could become famous!!)
  98.  
  99.  
  100. How it works
  101. ============
  102.  
  103. The program simply creates a textual list file, which can either be
  104. printed, or can be viewed online by your callers (eg with a TYPE1). The
  105. file contains page headers, and one line of text for each user in your
  106. userlog..... or rather for each user who matches the "restriction criteria"
  107. (see below).
  108.  
  109. You can define a "page length": when you do this, the program will insert a
  110. "%MORE%" at the relevant places. When viewed online, the user will then see
  111. the data a page at a time.
  112.  
  113. The file can have a set of file- and page-header lines, and a set of
  114. page-bottom lines: these are copied from the config file verbatim, so may
  115. contain "real-time" substitution parameters which TBBS will expand for you.
  116.  
  117. The lines of user data are then built up from lines of different types of
  118. data (eg words, substitution parameters and colourisation commands). If the
  119. data contains substitution parameters, then they are replaced by the
  120. relevant data from the userlog records.
  121.  
  122. For example, the set of data might include:
  123.  
  124.   header "A list of names etc"
  125.   header "-------------------"
  126.   %X03%
  127.   %NAME%
  128.   Tab to column 20
  129.   %X95%
  130.   %PHONE%
  131.   Tab to column 35
  132.   %X22%
  133.   %ADDR1%
  134.   a ","
  135.   a space
  136.   %ADDR2%
  137.   a "."
  138.  
  139. (this is NOT actually how the data is defined... see below)
  140.  
  141. This would give a list something like this:
  142.  
  143. A list of names etc
  144. -------------------
  145. Paul Blitz         %X95%441962885696   %X22%25 Woodgreen Road, Winchester.
  146. Phil Becker        %X95%303 699 6565   %X22%15200 E. Girard Ave., Aurora.
  147. .... etc
  148.  
  149. The "file header" gets printed once, at the top of the file. The "page
  150. headers" are printed at the top of the second and subsequent pages (after a
  151. "%MORE%").
  152.  
  153. The way the data is created is defined by the config file (see below). If
  154. you want to create several lists, then you simply create multiple
  155. configuration files, and run LOGLIST multiple times, specifying the
  156. different config files.
  157.  
  158.  
  159.  
  160. Config File format
  161. ==================
  162.  
  163. The config file format is, I hope, fairly straight-forward, and if best
  164. understood by looking at the supplied demo config files.
  165.  
  166. Column 1 of the file defines what that line is:
  167.  
  168.   U or u  - path & filename of your USERLOG.BBS file
  169.   O or o  - path & filename of the output file
  170.   L or l  - path & filename of the log file
  171.   F or f  - a file header line
  172.   P or p  - a page header line
  173.   B or b  - a page bottom line
  174.   R or r  - restriction criteria
  175.   D or d  - a data field
  176.   S or s  - a space setting
  177.   T or t  - a tab setting
  178.   M or m  - lines after which to insert a "%MORE%"
  179.   X or x  - special options
  180.  
  181. Anything else in column 1 will cause the rest of the line to be ignored:
  182. this is a good way of adding comments. To cover future expansion, I'd
  183. advise using a ";", as that will be reserved for comments in all future
  184. versions for comment lines (anything else could get used for something!)
  185.  
  186. Column 2 onwards holds the data. The line of data is ended by a <cr>
  187. (chr(13)). To make things predictable, all TRAILING spaces are removed (use
  188. the "S" or "T" command to include spaces at the end of the data)
  189.  
  190. Apart from the headers and comments, you may have upto 200 "items". These
  191. will display in the order they appear in the config file.
  192.  
  193.  
  194. Userlog, Output and Log files:
  195. ------------------------------
  196. These three line types define where your userlog, output, and error log
  197. files are. If you are silly enough to duplicate either of these, then the
  198. last one will be used. Each path/filename may be upto 50 characters long.
  199.  
  200. If the userlog file can not be found, the program will abort.
  201.  
  202. The output file will simply overwrite any existing file.
  203.  
  204. The log file will simply append to any existing file: at a minimum, the log
  205. will list the date / time of the run, and the config files used. The log
  206. file is not opened until the config file has been read (as that is where
  207. the error log's name is defined), so errors in the config file which cause
  208. a program abort will not be logged (if this becomes a big problem, let me
  209. know, and I'll work out a way around it).
  210.  
  211. You would normally put these as the first three lines of your config file.
  212.  
  213.  
  214. File Header lines:
  215. ------------------
  216. You can have up to 10 file header lines, each limited to being 120
  217. characters long. They are simply copied verbatim to the beginning of the
  218. output file in the order they appear in the config file.
  219.  
  220. Whilst they need not be in a block at the top of the file, you'll probably
  221. find it easier if they are!
  222.  
  223. You can include ANY substitution parameters you like: as they will be
  224. copied verbatim, they will be "expanded" when the output file is displayed
  225. by TBBS. This could be a nice place to put a "clear-screen" or to put the
  226. time / date.
  227.  
  228.  
  229. Page Header lines:
  230. ------------------
  231. This text gets put at the top of every *new* page... in other words, it is
  232. the line or lines of text that follow the %MORE% command. It does NOT get
  233. put at the top of the first page, so you'll need to specifically duplicate
  234. any text you want in the HEADER fields.
  235.  
  236. As the program is simple, you COULD end up with just the page heading on
  237. the last page!
  238.  
  239. You might want to include a "clear screen" in this.... if so, put it on the
  240. first line (pretty obvious, I realise), as there is no special handling of
  241. page length (for the %more% insertion) if you DO include the clear-screen.
  242.  
  243. You can include what you like in these lines: it is interpreted just like
  244. the File Header lines. You may have up to 5 of these lines, each of up to
  245. 120 chars.
  246.  
  247.  
  248. Page Bottom lines:
  249. ------------------
  250. This text gets put at the bottom of every page... in other words, it is
  251. the line or lines of text that immediately precede the %MORE% command. You
  252. might want to use this for a dashed line, or maybe to insert a special
  253. message.
  254.  
  255. You can include what you like in these lines: it is interpreted just like
  256. the File/Page Header lines. You may have up to 5 of these lines, each of up
  257. to 120 chars.
  258.  
  259.  
  260. Restriction Criteria
  261. --------------------
  262. The restriction criteria allows you to output just a selected subset of
  263. your userlog, based on specified user settings (eg priv level, A flags...)
  264.  
  265. If you don't specify any restrictions, ALL entries in the userlog will be
  266. listed.
  267.  
  268. There are two types of "matching" in the restrictions, numerical value, and
  269. flag(s):
  270.  
  271. a) Numerical value
  272.    The format of this command is "r[name]['>' or '=' or '<'][0-255]". For
  273.  example, to list users whose priv is under 100 you would use "rpriv<100".
  274.  
  275. b) Flag(s)
  276.    The format of this command is "r[name]=[flag(s)]". Where [flags(s)] are
  277.  either 'X' (or 'x', = set) or '.' (= reset) or '-' (don't care).
  278.    Depending on the actual command, there may only be a single flag (eg
  279.  "rinvisible=X") or 8 flags (eg "rA1=XXXX....").
  280.    Note that *ALL* bits of the flag must be defined (ie all 8 for an
  281.  a-flag).
  282.  
  283. If you duplicate a restriction type (eg two "RPRIV" lines) the last one
  284. only will be used.
  285.  
  286. If more than one (different) restriction is specified, then ALL conditions
  287. must be met for inclusion on the listing.
  288.  
  289. A full list of the supported restriction fields will be found in
  290. "_RESTRIC.TXT"
  291.  
  292.  
  293.  
  294. Data fields:
  295. ------------
  296. Visible fields can contain fixed data (eg "Name: "), substituted data (eg
  297. "%FIRST%", or colourisation data (eg "%X0F%"). The program ignores the
  298. "size" of any %Xnn% colourisation commands (as they are not actually
  299. displayed), so that tab parameters etc will be in the correct locations
  300. when displayed online (as an added bonus, any %Xnn% colourisation commands
  301. within the user data will also be respected).
  302.  
  303. The substitution codes supported are generally the same as those listed in
  304. the TBBS 2.3 manual / TBBS 2.3 ULEDIT.DOC file. However, certain fields,
  305. don't really make sense (eg %TIME%) in a list like this, so they are not
  306. included.
  307.  
  308. (my TBBS manual shows the full list on pages 2-15 thru 2-17)
  309.  
  310. You may include spaces within the string of data, but all trailing spaces
  311. will be removed (that way things are 100% predictable, and you won't get
  312. caught out!)
  313.  
  314. Each data field definition is limited to 50 characters: if you need a
  315. longer field, use multiple fields!
  316.  
  317. Note: whilst you can include escape sequences in the data fields, this
  318. program will treat them like normal "visible" data: this means that not
  319. only will they will (wrongly) count towards the line length (making tab
  320. positions incorrect), they will also be deleted - perhaps only partially -
  321. when truncating a line for tabbing. I therefore suggest that you DO NOT USE
  322. ANSI ESCAPE SEQUENCES, but use the %Xnn% sequences instead.
  323.  
  324. A full list of the supported substitution codes will be found in
  325. "_PARAMS.TXT"
  326.  
  327.  
  328. Space fields:
  329. -------------
  330. Just follow the "s" by the number of spaces you want... as data fields
  331. can't have any trailing spaces, you can use this to add them!
  332.  
  333. Valid range is 1 to 255.
  334.  
  335.  
  336. Tab fields:
  337. -----------
  338. Follow the "t" by the desired column. The way this works is that the
  339. "string so far" will be trimmed, and spacea added as needed, so that the
  340. next character will be in the specified column.
  341.  
  342. If you want to make the trimmed data have a space before the next data,
  343. then either use another "tab" field, or a "space" field straight after.
  344.  
  345. (eg: data so far on the line fills 43 chars. You wish to truncate this to
  346. 30 with a"t30" command: if you do that, there will be no space between the
  347. existing data, and the new field at the 30th column. To get a space in
  348. column 29 [so that there is a definte column break], tab to 29, then either
  349. now tab to 30, or insert a single space)
  350.  
  351. Tab fields will safely ignore any %Xnn% fields when it truncates lines.
  352.  
  353. Valid range is 1 to 255.
  354.  
  355.  
  356. More field:
  357. -----------
  358. Rather than the list being one long list, you might prefer to automatically
  359. insert a "%MORE%" every X lines... the number following the "m" is the
  360. number of "lines per screen" you want displaying.... so if you make this =
  361. 23, then the %MORE% will appear on the 23rd line.
  362.  
  363. The "page bottoms" are inserted prior to this line, and "page header" lines
  364. are added after this line.
  365.  
  366. Valid range is 1 to 255.
  367.  
  368.  
  369. Special Options
  370. ---------------
  371. This is my way of picking up any odd things. The second character defines
  372. WHICH special option it is.
  373.  
  374. "X1" defines the two characters used to replace the starting & ending "%"
  375. signs on any %xxxx% fields (not including %Xnn%, which are not affected)
  376. found in the userlog data - for example, some sysops use the location field
  377. for a user's "tag-line", which can contain things like "%Location%".
  378.  
  379. If we left these as they are, then they would be substituted at run-time,
  380. and we would find that our lovely tabs are all wrong!
  381.  
  382. To get around this, Log Lister simply changes the % signs! A setting of
  383. "X1<>" would make a "%location%" in a user's data become "<location>".
  384.  
  385. If you WANT to leave the "%" symbols there, then just use "X1%%".......
  386.  
  387.  
  388. "X2" enables "HTML mode": in this mode, anything within "<xxxxx>" is not
  389. counted towards tab positions (just like the "%Xnn%" sequences), so any
  390. embedded HTML is not lost if the dta has to be truncated.
  391.  
  392.  
  393. Other Special Options may be defined in the future.
  394.  
  395.  
  396. Other
  397. -----
  398. The overall line length of the output data is limited to 255 characters. If
  399. it gets longer, then it will simply truncate.
  400.  
  401.  
  402.  
  403. %zzzzz% Field Formatting
  404. ========================
  405.  
  406. Log Lister allows you to optionally include field formatting information in
  407. the %zzzzz% commands used on data lines. The syntax is (I hope) exactly the
  408. same as used in the ULEDIT printing template files.
  409.  
  410. Normally, a parameter looks like %zzzzz% (eg %NAME%), which will simply add
  411. that data to the print-line.
  412.  
  413. However, by adding in a ":" followed by further information, you can (a)
  414. set the length of that printed data (which either trims it, or pads it
  415. out); (b) left or right justify the data; (c) choose whether to use either
  416. spaces or zeros to pad the data.
  417.  
  418. The syntax is quite simple:
  419.  
  420.     %zzzzz[:[+|-]nnn[U|L|C]]%
  421.  
  422. where:  zzzzz is the "substitution" code
  423.         nnn   is a numerical value, range 1 to 255.
  424.  
  425. The formatting information starts with the ":". This may then be followed
  426. by nnn to define the string size (eg ":25"): this will either TRIM the data
  427. to nnn chars (if > nnn chars), or will LEFT justify the data in a nnn
  428. character string. This is also equivalent to prefixing the string size with
  429. a "-" (eg ":-25").
  430.  
  431. If you prefix the string size with a "+" (eg "+25"), then the data will be
  432. RIGHT justified.
  433.  
  434. (If you don't include a number, then the field will be left the same size
  435. as it was)
  436.  
  437. Normally, the resulting string will be padded with spaces (great for
  438. textual fields), but if you start nnn with a "0" (eg "017" instead of just
  439. "17"), then the string gets padded with "0"s instead (great for numerical
  440. fields).
  441.  
  442. If you end the formatting with U, L or C, then that will change the "case"
  443. of the text. "U" will give you the data in *UPPER CASE*, "L" will give you
  444. *lower case*, whilst "C" will give you *Mixed Case*.
  445.  
  446. Let's look at a few of examples... we'll assume that %NAME% is "PAUL
  447. BLITZ", and that %BYTES24% is 12345:
  448.  
  449.                               123456789012345    <<<--- ruler
  450.            %NAME:+15C%    is "     Paul Blitz"
  451.            %NAME:-15L%    is "paul blitz     "
  452.            %NAME:C%       is "Paul Blitz"
  453.            %BYTES24:+07%  is "0012345"
  454.            %BYTES24:-7%   is "12345  "
  455. silly examples:
  456.            %NAME:+015U%   is "00000PAUL BLITZ"
  457.            %BYTES24:-07%  is "1234500"
  458.  
  459.  
  460. The formatting commands can be used with ANY visible %xxx% substitution,
  461. and will override any case-specifics that the %xxx% may otherwise have.
  462.  
  463. Watch out for unexpected things.... flag fields, normally "X..XXX..." will
  464. become "x..xxx...".
  465.  
  466.  
  467. Thanks...
  468. =========
  469.  
  470. Thanks to lots of people:
  471.  
  472. .... to Michael Muller for coming up with the original idea (which expanded
  473. a bit from his original ideas!), and for beta testing the program. Also to
  474. Robert Gagliano, who also beta tested.
  475.  
  476. .... to the eSoft crew for not only creating TBBS, but for answering a few
  477. questions along the way to help me write the program.
  478.  
  479. .... to Scott Sturgis at Zone One for distributing the program in the US,
  480. and giving encouragement (and maybe some $$$ if you all register!!)
  481.  
  482. .... to Borland for creating Turbo Pascal (version 4) which all my programs
  483. are written in.
  484.  
  485. .... to my family, who allow me to sit in my "computer room" writing email
  486. to all you strange people in the US (I met many of you at ONEBBSCON '95, so
  487. I KNOW how strange you are<g>), as well as programming.
  488.  
  489. .... to God, for creating me, and giving me the skills he has done!
  490.  
  491.  
  492. Demonstration Version
  493. =====================
  494.  
  495. This DEMONSTRATION VERSION of the Log Lister program is a fully functional
  496. program, with *two* single exceptions: First, this version of the program
  497. will only print out from the first 30 records of your TBBS userlog (your
  498. listing may contain fewer lines of output if you use the restriction
  499. commands). That should be more than enough to let you decide whether the
  500. fully registered version of the program will be of use to you. Second, the
  501. top of your output file will have a "nag line" or three added.... even more
  502. reason to buy the proper program!
  503.  
  504. See below for how to buy the full version.
  505.  
  506.  
  507. Copyright etc:
  508. ==============
  509.  
  510. This program is the copyright of Paul Blitz, 1995/6.
  511.  
  512. This demonstration version of the program may be freely used to help you
  513. decide whether the full version will be of use to you. It may be freely
  514. distributed, by any means (including via a BBS, on a CD etc) to all others,
  515. on the simple condition that ALL files included in this archive are
  516. included. Feel free to re-archive it using a different archiver.
  517.  
  518. Whilst I believe that this program works correctly, I do not GUARANTEE it.
  519. All that I WILL guarantee is that it will take up space on your disk drive,
  520. and that running the program may well cause it's output to take up even
  521. more space!
  522.  
  523. It is up to *you* to decide that the program does what you want: I can not
  524. be held responsible for any damage caused by this program to your computer,
  525. the files on your computer, NOR for any other "knock-on" effects / damage
  526. caused (eg loss of business), etc.
  527.  
  528. *************************************************************************
  529. The FULL version of this product may NOT be copied, other than for taking
  530. suitable security backups.
  531. *************************************************************************
  532.  
  533.  
  534. Purchasing the fully-working version
  535. ====================================
  536.  
  537.  
  538. The fully registered version of LOGLIST is available exclusively from:
  539.  
  540.  
  541. Paul Blitz,                            paul.blitz@enterprise.net
  542. 25, Woodgreen Road,
  543. Harestock,
  544. Winchester,
  545. Hants,
  546. SO22 6LZ.
  547.  
  548. OR
  549.  
  550. zone one                               zoneone@primenet.com
  551. 8424A Santa Monica Blvd #200
  552. West Hollywood, CA. 90069
  553.  
  554. Vox: 213.653.6450
  555.  
  556.  
  557. (Please refer to the BUY_ME.TXT file for pricing details.)
  558.  
  559.  
  560. If you have any bright suggestions, then feel free to write to me, or
  561. contact me by phone at home (between 20:00 and 22:00 (UK time) ONLY please)
  562. on +44 1962-885696.
  563.  
  564. You may call my BBS: "The Cardboard Box BBS" on +44 1962-880278 (for those
  565. of you in the UK, who don't understand international dialling, call 01962
  566. 880278).
  567.  
  568. You can send email to me at Fidonet 2:252/201, Chatnet 44:2520/201, or
  569. Internet "paul.blitz@enterprise.net", or on the eSoft BBS.
  570.  
  571.  
  572.  
  573.